import { createRouter, createWebHistory } from 'vue-router'

//导入组件
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'
import StudentVue from '@/views/system/student/Student.vue'
import AdminVue from '@/views/system/admin/Admin.vue'
import TeacherVue from '@/views/system/teacher/Teacher.vue'
import ClassroomVue from '@/views/system/classroom/Classroom.vue'
import CourseVue from '@/views/system/course/Course.vue'
import MajorVue from '@/views/system/major/Major.vue'
import ManageVue from '@/views/system/manageCourse/Manage.vue'
import ScoreVue from '@/views/system/score/Score.vue'







//定义路由关系
const routes = [
    { path: '/', component: LoginVue },

    {
        path: '/layout', component: LayoutVue,redirect:'/system/student', children: [
            { path: '/system/student', component: StudentVue },
            { path: '/system/teacher', component: TeacherVue },
            { path: '/system/admin', component: AdminVue },
            { path: '/system/classroom', component: ClassroomVue },
            { path: '/system/course', component: CourseVue },
            { path: '/system/major', component: MajorVue },
            { path: '/system/manage', component: ManageVue },
            { path: '/system/score', component: ScoreVue }

        ]
    },

]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

//导出路由
export default router
